﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace Steer
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();

            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
        }

        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering);
            myStar.position = new Vector2D(100, 100);
            myStar.velocity.length = 5;
            myStar.velocity.angle = Math.PI / 4;
        }

        void CompositionTarget_Rendering(object sender, EventArgs e)
        {
            myStar.update();
        }
    }
}
